//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef _CACHE_H_
#define _CACHE_H_

EXTERN_C void flush_dcache_line(unsigned long addr);
EXTERN_C void Invalid_dcache_line(unsigned long addr);

EXTERN_C void cache32_unroll32_Index_D(UInt32);
EXTERN_C void cache16_unroll32_Index_D(UInt32);
EXTERN_C void cache32_unroll32_Index_I(UInt32);
EXTERN_C void cache16_unroll32_Index_I(UInt32);
EXTERN_C void cache32_unroll32_Hit_D(UInt32);

EXTERN_C void blast_dcache32(void);
EXTERN_C void blast_dcache32_page(unsigned long page);
EXTERN_C void blast_dcache32_page_indexed(unsigned long page);
EXTERN_C void blast_icache32_page_indexed(unsigned long page);
EXTERN_C void blast_icache32(void);
EXTERN_C void flush_icache_range(unsigned long start,unsigned long end);
EXTERN_C void flush_cache_all(void);

EXTERN_C void protected_flush_icache_line(unsigned long addr);
EXTERN_C void protected_writeback_dcache_line(unsigned long addr);
EXTERN_C void flush_cache_sigtramp(unsigned long addr);
EXTERN_C void dma_cache_wback_inv(unsigned long addr, unsigned long size);
EXTERN_C void dma_cache_inv(unsigned long addr, unsigned long size);
EXTERN_C void dma_cache_wback(unsigned long addr, unsigned long size);
EXTERN_C void InitCache();
EXTERN_C void sysCallFlushDCache(Address addr, UInt32 size);
EXTERN_C void dumpCacheInfo();
EXTERN_C void r4k_init_cache();
EXTERN_C void r4k_flush_cache();

EXTERN_C UInt32 icache_size, dcache_size;
EXTERN_C UInt32 ic_lsize, dc_lsize;

EXTERN_C void BlastDCache();
EXTERN_C void BlastICache();

EXTERN_C void FlushCache();

#endif
